/*! \file
 * \brief Enter a brief description here.
 *
 * Enter a detailed description here. (optional)
 * \author Author (Ivo Wingelaar)
 * \date Date (2011)
 * \version Version (0.0.1)
 * \copyright Copyright (GNU LGPL v3)
 */

#include "LynxOSManagerLinux_C.hpp"

#ifdef _LYNX_LINUX_

#include <sys/utsname.h>

namespace Lynx
{

/** constructor **/
/// \param    WindowManagerLinux_C *window
///         A pointer to the windowmanager.
OSManagerLinux_C::OSManagerLinux_C(WindowManagerLinux_C* window) :
    mWindow(window),
    mOperatingSystem("")
{
    struct utsname LinuxInfo;
    uname(&LinuxInfo);

    mOperatingSystem += LinuxInfo.sysname;
    mOperatingSystem += " ";
    mOperatingSystem += LinuxInfo.release;
    mOperatingSystem += " ";
    mOperatingSystem += LinuxInfo.version;
    mOperatingSystem += " ";
    mOperatingSystem += LinuxInfo.machine;
}

/** default destructor **/
OSManagerLinux_C::~OSManagerLinux_C()
{
    //
}

/** const virtual function **/
/** get_os_version         **/
//! Returns a string containing the name and the version of the os.
/// \return std::string
///         A string containing the name and the version of the os.
/// \param  void
std::string OSManagerLinux_C::get_os_version(void) const
{
    return mOperatingSystem.c_str();
}

/** const virtual function **/
/** copy_to_clipboard      **/
//! Copies a string the to clipboard.
/// \return void
/// \param    const std::string& str
///         The string you want to copy to the clipboard.
void OSManagerLinux_C::copy_to_clipboard(const std::string& str) const
{
    /*
       if(mWindow)
           mWindow->copyToClipboard(str);*/
}

/** const virtual function **/
/** get_from_clipboard     **/
//! Returns a string from the clipboard.
/// \return std::string
///         A string from the clipboard.
/// \param  void
std::string OSManagerLinux_C::get_from_clipboard(void) const
{
    /*
       if(mWindow)
           return mWindow->getTextFromClipboard();
       else
           return 0;*/
}

/** const virtual function  **/
/** get_processor_speed_mhz **/
//! Returns the processor speed in MHz.
/// \return bool
///         True if the call succeeded, false otherwise.
/// \param    uint32_t& mhz
///         The speed in mhz.
bool OSManagerLinux_C::get_processor_speed_mhz(uint32_t& mhz) const
{
    return false;
}

/** const virtual function **/
/** get_processor_count    **/
//! Returns the number of processors.
/// \return bool
///         True if the call succeeded, false otherwise.
/// \param    uint32_t& count
///         The number of processors.
bool OSManagerLinux_C::get_processor_count(uint32_t& count) const
{
    return false;
}

/** const virtual function **/
/** get_system_memory      **/
//! Returns a few stats on ram-memory.
/// \return bool
///         True if the call succeeded, false otherwise.
/// \param    uint32_t* total
///         The total amount of ram installed.
/// \param    uint32_t* available
///         The amount of ram available.
bool OSManagerLinux_C::get_system_memory(uint32_t* total,
        uint32_t* available) const
{
    return false;
}

} // namespace Lynx

#endif // _LYNX_LINUX_
